%{
#include <stdio.h>
#include <stdlib.h>
extern int yylex();
extern void yyerror(char *);
%}

%union {
int int_token;
}

%token <int_token> QUIT HELLO SEMICOLON

%start root_node

%%

root_node: hello_node root_node  | quit_node 
hello_node: HELLO SEMICOLON { printf("parsed a hello node\n Hello\n");}
quit_node: QUIT SEMICOLON {printf("parsed a quit node\n Goodbye\n"); exit(-1);}
